package com.lee.wordcounter.utils;

import java.util.HashMap;

public class Timer {
    public static long startTime = 0;
    public static long endTime = 0;
    public static HashMap <String, Long> map = new HashMap <String, Long>();

    
	public static void startTimer() {
    	startTime = System.currentTimeMillis();
    }
	public static void endTimer() {
		endTime = System.currentTimeMillis();
	}
	public static void storeReading(String key) {
		map.put(key, new Long(endTime - startTime));
	}
	public static long getReading(String key) {
		Long ret = map.get(key);
		if (ret != null) {
			return ret.longValue();
		}
		return 0;
	}
}
